﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B303Langf.Parser.AST
{
   public class IfStatement : Statement
   {
      public IfStatement( Expression conditionExpression, Block ifBlock )
      {
         ConditionExpression = conditionExpression;
         IfBlock = ifBlock;
         ElseBlock = null;
      }

      public IfStatement( Expression conditionExpression, Block ifBlock, Block elseBlock )
      {
         ConditionExpression = conditionExpression;
         IfBlock = ifBlock;
         ElseBlock = elseBlock;
      }

      public Expression ConditionExpression
      {
         get;
         private set;
      }

      public Block IfBlock
      {
         get;
         private set;
      }

      public Block ElseBlock
      {
         get;
         private set;
      }

      public override object Visit( IVisitor v, object obj )
      {
         return v.VisitIfStatement( this, obj );
      }
   }
}
